﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;

namespace Neeko.XNA.UI
{
    public class UIContainer : UIElement
    {
        public List<UIElement> Elements { get; private set; }

        public UIContainer()
        {
            this.Elements = new List<UIElement>();
        }

        public override void Update(GameTime gameTime, MouseState mouseState)
        {
            if (this.Visible && this.Enabled)
            {
                foreach (UIElement uiElement in this.Elements)
                {
                    uiElement.Update(gameTime, mouseState);
                }
            }
        }

        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            if (this.Visible)
            {
                foreach (UIElement uiElement in this.Elements)
                {
                    uiElement.Draw(spriteBatch, gameTime);
                }
            }
        }
    }
}
